package net.trade.trade.dao.impl;

import java.util.List;
import net.trade.base.bean.TBusilog;
import net.trade.base.bean.TBusilogExample;
import net.trade.trade.dao.TBusilogDAO;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

@Repository
public class TBusilogDAOImpl extends SqlMapClientDaoSupport implements TBusilogDAO {

    public TBusilogDAOImpl() {
        super();
    }

    public void insert(TBusilog record) {
        getSqlMapClientTemplate().insert("t_busilog.abatorgenerated_insert", record);
    }

    public int updateByPrimaryKey(TBusilog record) {
        int rows = getSqlMapClientTemplate().update("t_busilog.abatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    public int updateByPrimaryKeySelective(TBusilog record) {
        int rows = getSqlMapClientTemplate().update("t_busilog.abatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    public List selectByExample(TBusilogExample example) {
        List list = getSqlMapClientTemplate().queryForList("t_busilog.abatorgenerated_selectByExample", example);
        return list;
    }

    public TBusilog selectByPrimaryKey(String blFlowno) {
        TBusilog key = new TBusilog();
        key.setBlFlowno(blFlowno);
        TBusilog record = (TBusilog) getSqlMapClientTemplate().queryForObject("t_busilog.abatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    public int deleteByExample(TBusilogExample example) {
        int rows = getSqlMapClientTemplate().delete("t_busilog.abatorgenerated_deleteByExample", example);
        return rows;
    }

    public int deleteByPrimaryKey(String blFlowno) {
        TBusilog key = new TBusilog();
        key.setBlFlowno(blFlowno);
        int rows = getSqlMapClientTemplate().delete("t_busilog.abatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    public int countByExample(TBusilogExample example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("t_busilog.abatorgenerated_countByExample", example);
        return count.intValue();
    }

    public int updateByExampleSelective(TBusilog record, TBusilogExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("t_busilog.abatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    public int updateByExample(TBusilog record, TBusilogExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("t_busilog.abatorgenerated_updateByExample", parms);
        return rows;
    }

    private static class UpdateByExampleParms extends TBusilogExample {
        private Object record;

        public UpdateByExampleParms(Object record, TBusilogExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}